package b.p.b;

import android.view.View;
import android.widget.Scroller;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.m;
import androidx.recyclerview.widget.RecyclerView.o;
import androidx.recyclerview.widget.RecyclerView.q;

/* compiled from: SnapHelper */
public abstract class e0 extends o {
    public RecyclerView a;
    public Scroller b;
    public final q c = new a();

    /* compiled from: SnapHelper */
    public class a extends q {
        public boolean a = false;

        public void a(RecyclerView recyclerView, int i) {
            if (i == 0 && this.a) {
                this.a = false;
                e0.this.c();
            }
        }

        public void b(RecyclerView recyclerView, int i, int i2) {
            if (i != 0 || i2 != 0) {
                this.a = true;
            }
        }
    }

    public abstract int[] a(m mVar, View view);

    public abstract View b(m mVar);

    public void c() {
        RecyclerView recyclerView = this.a;
        if (recyclerView != null) {
            m layoutManager = recyclerView.getLayoutManager();
            if (layoutManager != null) {
                View b = b(layoutManager);
                if (b != null) {
                    int[] a = a(layoutManager, b);
                    if (!(a[0] == 0 && a[1] == 0)) {
                        this.a.m0(a[0], a[1], null, Integer.MIN_VALUE, false);
                    }
                }
            }
        }
    }
}
